// Author: wsfuyibing <682805@qq.com>
// Date: 2025-04-25

package kind

// PayKind
// 支付类型.
type PayKind int

const (
	PayKindUser          PayKind = 1 // 用户自付 - 扣除优惠与抵扣部分, 余下需用户线上或线下支付的部分.
	PayKindUserBalance   PayKind = 2 // 余额支付
	PayKindMember        PayKind = 3 // 会员特权 - 钓场会员享受优惠.
	PayKindCoupon        PayKind = 4 // 优惠部分 - 由优惠券承担的部分.
	PayKindAdminDiscount PayKind = 5 // 运营优惠 - 由卖家(钓场管理员)调整的部分.
)

var (
	PayKindTexts = map[PayKind]string{
		PayKindUser:          "自付金额",
		PayKindUserBalance:   "余额支付",
		PayKindMember:        "会员特权抵扣",
		PayKindCoupon:        "优惠券抵扣",
		PayKindAdminDiscount: "运营抵扣",
	}
)

func (o PayKind) CanReset() bool { return o == PayKindAdminDiscount }

func (o PayKind) IsCoupon() bool      { return o == PayKindCoupon }
func (o PayKind) IsUserBalance() bool { return o == PayKindUserBalance }

func (o PayKind) Text() string {
	if str, ok := PayKindTexts[o]; ok {
		return str
	}
	return ""
}
